﻿package Game.LogicSystem.Objects {
	import Game.MouseSystem.MouseManager;
	import Game.Utils.T;
	
	import flash.display.MovieClip;
	
	public class ObjectClass extends MovieClip{
		
		// Constants:
		// Public Properties:
		// Private Properties:
		protected var i_ObjectName:String;
		protected var i_ObjectClassName:String;
		protected var i_ObjectPrice:int=1;
		
		// Protected Properties:
		protected var objName:String;
		protected var m_Parent:*;
		protected var i_ObjectTypeRef:int;
		public function getObjectType():int{
			return this.i_ObjectTypeRef;
		}
		// Initialization:
		public function ObjectClass(_posx:int,_posy:int,_givenName:String,_ManagerRef:*,_objtype:int) { 
			m_Parent = _ManagerRef;
			objName=_givenName;
			i_ObjectTypeRef= _objtype;
			this.x = _posx;
			this.y = _posy;
			this.registerActions();
		}
		
		private function registerActions():void{
			MouseManager.registerClickable(this,onClickAction,null);
		}
		private function unregisterActions():void{
			MouseManager.unregisterClickable(this);
		}
		
		public function onClickAction():void{
			T.Trace(this.objName,1,"ObjectClass/");
			m_Parent.getActionsFor(this);
		}
		
		public function onOverAction():void{
			
		}
	
		// Public Methods:
			//Accessors:
		public function get ObjectName():String{
			return i_ObjectName;
		}
		public function get ObjectPrice():int{
			return i_ObjectPrice;
		}
		public function get ObjectClassName():String{
			return i_ObjectClassName;
		}
		// Protected Methods:
	}
	
}